<template>
  <div class="wrapper">
    <el-form>
      <el-form-item>
        <el-button type="primary"
          size="small" @click="toggleFn" v-has="'memberconfigredact'">配置会员卡</el-button>
         <el-button type="primary"
          size="small" v-if="memberCardList.length" @click="view" v-has="'memberconfigpreview'">会员卡预览</el-button>
      </el-form-item>
      <el-form-item>
        <el-table style="width: 100%" :data="memberCardList">
          <el-table-column prop="name"
            label="会员卡名称"
            width="180">
          </el-table-column>
          <el-table-column prop="num"
            label="会员卡等级"
            width="180">
          </el-table-column>
          <el-table-column prop="rightsNum"
            label="会员权益">
          </el-table-column>
          <el-table-column prop="night"
            label="间夜升级">
          </el-table-column>
          <el-table-column prop="integral"
            label="积分升级">
          </el-table-column>
          <el-table-column prop="pay"
            label="消费升级">
          </el-table-column>
        </el-table>
      </el-form-item>
    </el-form>

  </div>
</template>

<script>
import {getMemberCardList} from '@/public/js/member.js'
export default {
  components: {},
  props: ['toggleFn'],
  data() {
    return {
      memberCardList:[]
    };
  },
  watch: {},
  computed: {},
  methods: {
    view(){
      this.$router.push('/index/memberView')
    },
    //获取会员卡列表
    _getMemberCardList(){
      getMemberCardList().then(res=>{
      
        this.memberCardList = res.data.memberCardList;
      })
    }
  },
  created() {
    this._getMemberCardList()
  },
  mounted() {}
};
</script>
<style lang="scss" scoped>
.wrapper {
}
</style>